package com.sqlcheck.dto.response;

import com.sqlcheck.entity.SqlStatement;
import lombok.Builder;
import lombok.Data;

import java.util.List;
import java.util.Map;

@Data
@Builder
public class SqlStatementVO {
    private Long taskId;
    private Integer statementNumber;
    private String sqlContent;
    private SqlStatement.SqlType sqlType;
    private SqlStatement.SourceType sourceType;
    private Boolean isNativeQuery;
    
    // Git扫描相关字段
    private String sourceFile;
    private Integer lineNumber;
    private String className;
    private String methodName;
    private SqlStatement.JavaAnnotationType javaAnnotationType;
    private SqlStatement.MybatisXmlElement mybatisXmlElement;
    private String gitUrl;
    
    // DDL扫描相关字段
    private SqlStatement.DdlType ddlType;
    private String primaryTable;
    private List<String> affectedTables;
    private Map<String, Object> databaseObjects;
    
    // 通用字段
    private Map<String, Object> extractionMetadata;
    
    // 问题统计字段
    private Integer issueCount;        // 问题总数
    private Boolean hasIssues;        // 是否有问题
    private Map<String, Integer> issuesBySeverity;  // 按严重程度分组的问题数量
}